#ifndef CHARTS_H
#define CHARTS_H

#include <QWidget>
#include <QPushButton>
#include <QMutex> // 用于线程安全
#include "detail.h"

namespace Ui {
class charts;
}

class charts : public QWidget
{
    Q_OBJECT

public:
    // 获取单例实例的方法
    static charts* getInstance(QWidget* parent = nullptr);

    // 禁止拷贝和赋值操作
    charts(const charts&) = delete;
    charts& operator=(const charts&) = delete;

    ~charts();

private:
    explicit charts(QWidget* parent = nullptr); // 构造函数设置为私有
    static charts* instance; // 静态实例指针
    static QMutex mutex;     // 线程安全保护

    Ui::charts* ui;
public:
    QPushButton* widgetButton;
    QPushButton* widget2Button;
    QPushButton* widget3Button;
    QPushButton* widget4Button;
    QPushButton* widget5Button;
    QPushButton* widget6Button;
};

#endif // CHARTS_H
